<!--
 * @Author: CPS
 * @email: 373704015@qq.com
 * @Date: 2021-09-08 14:56:50.313993
 * @Last Modified by: CPS
 * @Last Modified time: 2021-09-08 14:56:50.314990
 * @Filename home
 * @Description: 功能描述
-->

<template lang="pug">
#myChart(style="width: 800px; height: 600px")
</template>

<script>
import testData from "./testData.js";

export default {
  components: {},
  computed: {},
  created() {
    // 准备数据
  },
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    this.myChart = this.$echarts.init(document.getElementById("myChart"));

    this.draw();

    // console.log("testData: ", testData);
  },

  data() {
    return {
      myChart: null,
      data: {},
    };
  },

  methods: {
    draw() {
      // 绘制图表
      this.myChart.setOption(testData.option);
    },
  },
};
</script>

<style lang="stylus" scoped></style>
